public class MyRunDad implements Runnable {
	private int contj1 = 0;
	private int contj2 = 0;

	@Override
	public void run() {
		boolean fin = false;
		while (!fin) {
			MyRunSonOne r1 = new MyRunSonOne();
			MyRunSonTwo r2 = new MyRunSonTwo();

			Thread h1 = new Thread(r1);
			Thread h2 = new Thread(r2);

			h1.start();
			h2.start();

			try {
				h1.join();
			} catch (InterruptedException e) {
			}
			try {
				h2.join();
			} catch (InterruptedException e) {
			}
			System.out.println(imprimir(r1.getJ1()));
			System.out.println(imprimir(r2.getJ2()));
			System.out.println(ganador(r1.getJ1(), r2.getJ2()));

			if (this.ganadorFinal(this.contj1, this.contj2) != null) {
				System.out.println(this.ganadorFinal(this.contj1, this.contj2));
				fin = true;
			}
		}
	}

	public String ganador(int n1, int n2) {
		String x = "";
		// Piedra vs papel
		if (n1 == 1 && n2 == 2) {
			x = "Ganador el jugador 2";
			contj2++;
		}
		// Papel vs Piedra
		else if (n1 == 2 && n2 == 1) {
			x = "Ganador el jugador 1";
			contj1++;
		}
		// Tijera vs Piedra
		else if (n1 == 3 && n2 == 1) {
			x = "Ganador el jugador 2";
			contj2++;
		}
		// Piedra vs Tijera
		else if (n1 == 1 && n2 == 3) {
			x = "Ganador el jugador 1";
			contj1++;
		}
		// Tijera vs Papel
		else if (n1 == 3 && n2 == 2) {
			x = "Ganador el jugador 1";
			contj1++;
		}
		// Papel vs Tijera
		else if (n1 == 2 && n2 == 3) {
			x = "Ganador el jugador 2";
			contj2++;
		}
		// Piedra vs Piedra
		else if (n1 == 1 && n2 == 1) {
			x = "*** Empate ***";
		}
		// Papel vs Papel
		else if (n1 == 2 && n2 == 2) {
			x = "*** Empate ***";
		}
		// Tijera vs Tijera
		else if (n1 == 3 && n2 == 3) {
			x = "*** Empate ***";
		}
		return x;
	}

	public String imprimir(int num) {
		String x = "";
		if (num == 1)
			x = "Piedra";
		else if (num == 2)
			x = "Papel";
		else
			x = "Tijera";
		return x;
	}

	public String ganadorFinal(int n1, int n2) {
		String x = "";
		if (n1 == 3)
			x = "********* Ganador Jugador 1 *********";
		else if (n2 == 3)
			x = "********* Ganador Jugador 2 *********";
		else
			x = null;
		return x;
	}
}
